<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>

	<body>
		<div id="app">
			<cpn></cpn>
			<hr />
			<cpn><span>哈哈哈</span></cpn>
			<hr />
			<cpn><h3>可可可</h3></cpn>
			<hr />
			<cpn></cpn>
			<hr />
			<cpn>
				<p>我是另外的段落</p>
				<h3>我是另外的内容</h3>
			</cpn>
		</div>
		<!-- 
	1.插槽的基本使用
2.插槽的默认值
3.如果组件中间有多个值，插槽会一起替换 
-->
		<template id="cpn">
			<div>
				<h2>我是组件标题</h2>
				<p>我是组件内容</p>
				<slot><button>按钮</button></slot>
			</div>
		</template>

		<script src="../lib/vue.js"></script>
		<script>
			let vm = new Vue({
				el: "#app",
				data: { message: "hello" },
				components: {
					cpn: {
						template: "#cpn"
					}
				}
			});
		</script>
	</body>
</html>
